<%
'#################################################################################
'## UnWritten Open Source Blog Engine
'#################################################################################
'## Copyright (C) 2008 Luigi Violin
'##
'## This program is free software: you can redistribute it and/or modify
'## it under the terms of the GNU General Public License as published by
'## the Free Software Foundation, either version 2 of the License, or
'## (at your option) any later version.
'##
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'## GNU General Public License for more details.
'##
'## You should have received a copy of the GNU General Public License
'## along with this program.  If not, see <http://www.gnu.org/licenses/>.
'##
'## You can obtain support from our forums at:
'##     <http://www.unwrittenblog.com/forums/>
'## Contact the author directly:
'##     <zaamit@hotmail.com/>
'##
'#################################################################################
%>
<!--#include file="check-login.asp"-->
<!--#include file="header.asp"-->
<!--#include file="sidebar.asp"-->

<div id="main">
	<div id="inner">

<h1>Welcome to your Control Panel</h1>
From here you can administrate pretty much every aspect of your website. Please check that you have the latest version of <strong>Unwritten Blog</strong> installed by visiting <a href="http://www.unwrittenblog.com">our official website</a>.
<hr />
<h3>Basic Stats</h3>
<ul>
	<li>Right now, there are <%=getPosts%> published <a href="post-list.asp">posts</a>, <%=getArticles%> published <a href="article-list.asp">articles</a>, and <%=getComments%> comments.</li>
    <li>There are <%=getUsers%> registered <a href="user-list.asp">users</a>, of which <%=getAdmins%> are site administrators.</li>
    <li>Last registered user is <strong><%=getLastUser%></strong>.</li>
</ul>
<hr />
<h3>Support</h3>
Visit the <a href="http://www.unwrittenblog.com/forums/">official Unwritten Blog forums</a> to get support and give feedback.<br /><br />
<strong>Unwritten Blog</strong> is free software; you can redistribuite it and/or modify it under the terms of the GNU/General Public License as published the Free software Foundation; either version 2 of the License, or (at your opinion) any later version.
<!-- /main inner --></div><!-- /main --></div>

<!--#include file="footer.asp"-->

<%
function getUsers()
	dbRS2.open "select count(id) from " & db_prefix & "users where ustatus = 1",dbConn
	getUsers = dbRS2(0)
	dbRS2.close
end function

function getAdmins()
	dbRS2.open "select count(id) from " & db_prefix & "users where ustatus = 1 and level = 10",dbConn
	getAdmins = dbRS2(0)
	dbRS2.close
end function

function getLastUser()
	dbRS2.open "select nick from " & db_prefix & "users where ustatus = 1 order by member_since desc limit 1",dbConn
	getLastUser = dbRS2(0)
	dbRS2.close
end function

function getPosts()
	dbRS2.open "select count(id) from " & db_prefix & "posts where publish_status = 1 and ent_type = 1",dbConn
	getPosts = dbRS2(0)
	dbRS2.close
end function

function getArticles()
	dbRS2.open "select count(id) from " & db_prefix & "posts where publish_status = 1 and ent_type = 2",dbConn
	getArticles = dbRS2(0)
	dbRS2.close	
end function

function getComments()
	dbRS2.open "select count(id) from " & db_prefix & "comments where status = 1",dbConn
	getComments = dbRS2(0)
	dbRS2.close	
end function
%>